# -*- mode: python -*-
{
  # Version of this test parameter file.
  'version': 'v0.01',

  'ui': {
    # Lowest and upper bounds for visualization of good and bad MTF values.
    'mtf_color_map_range': [0.1, 0.4],

    # Ignore enter key in serial number input.  (Some barcode readers
    # automatically input enter key, but we may prefer not to start the test
    # immediately after scanning barcode.)
    # This flag does not change the behavior of Space key.
    'ignore_enter_key': False
    },

  'cam_sn': {
    # Regular expression format for serial number.
    'format': r'^[a-zA-Z0-9]{4}$',

    # Whether to auto read serial number from sysfs.
    'auto_read': False,

    # source: could be either 'sysfs' or 'i2c'
    'source': 'i2c',

    # if source is sysfs
    'sysfs_path': '',

    # if source is i2c, you must specify these parameters
    'i2c_param': {
      'dev_node': '/dev/video0',
      'bus': 1,
      'chip_addr': 0x37,
      'data_addr': 0x3508,
      'length': 12
    },
  },

  'cam_fw': {
    # Whether to check firmware version.
    'fw_check': True,

    # Pathname of firmware version in sysfs.
    'fw_sysfs_path': '/sys/devices/exynos-dwc3/dwc3.0/xhci-hcd/usb3/3-1/bcdDevice',

    # Expected firmware version.
    'fw_version': '0009'
    },

  'cam_img': {
    # Buffer time for AWB and AE.
    'buf_time': 3.0,

    # Number of samples to average to produce low-noises image.
    'n_samples': 45
    },

  # Expected time duration of each test stage (used for progress bar).
  'chk_point_IQ': [
    ('cam_start', 0.1),
    ('cam_sn', 0.1),
    ('cam_fw', 0.1),
    ('cam_init', 0.1),
    ('cam_awb', 3.0),
    ('cam_img', 2.5),
    ('cam_vc', 0.25),
    ('cam_ls', 0.05),
    ('cam_mtf', 0.75),
    ('cam_end', 1.0),
    ('cam_data_saved', 0)
    ],

  # Expected time duration of each test stage (used for progress bar).
  'chk_point_ALS': [
    ('cam_start', 0.1),
    ('cam_sn', 0.1),
    ('cam_init', 0.1),
    ('cam_als_light1', 2.00),
    ('cam_als_light2', 2.00),
    ('cam_als_light3', 2.00),
    ('cam_als_vpd', 0.5),
    ('cam_end', 0.5),
    ('cam_data_saved', 0)
    ],

  # The following params references py/test/fixture/camera/static/iq.params
  # If you the structure of any of them, please make sure you update iq.params
  # as well.
  'cam_vc': {
    # Corner quality threshold when detecting corners.
    'min_corner_quality_ratio': 0.01,

    # Minimum allowed square edge length compared to image diagonal length when
    # detecting square blocks.
    'min_square_size_ratio': 0.022,

    # Minimum allowed corner distance compared to image diagonal length when
    # detecting corners.
    'min_corner_distance_ratio': 0.010,

    # Maximum allowed image position shift compared to image diagonal length.
    'max_image_shift': 0.08,

    # Maximum allowed image rotation in degrees.
    'max_image_tilt': 2.0
    },

  'cam_ls': {
    # Low-frequency variation check (sensitive to light uniformity).
    'check_low_freq': False,

    # Maximum acceptable response of low frequency variation.
    'max_response': 0.01,

    # Maximum acceptable shading ratio of boundary pixels.
    'max_shading_ratio': 0.30
    },

  'cam_mtf': {
    # Minimum acceptable median MTF value of all edge samples.
    # For example, it compares with the 154th value out of 308 samples.
    'min_pass_mtf': 0.21,

    # Minimum acceptable lowest MTF value of all edge samples.
    # For example, it compares with the lowest 308th value of 308 samples.
    'min_pass_lowest_mtf': 0.105,

    # Maximum number of edges to compute MTF values.
    # Test chart A: 7 x 11 x 4 = 308
    # Test chart B: 7 x 9 x 4 = 252
    'mtf_sample_count': 308,

    # Patch width for MTF calculation (typical values: 10 for VGA, 20 for 720p).
    'mtf_patch_width': 20,

    # How much to crop at the beginning and the end of an edge.
    'mtf_crop_ratio': 0.25,

    # Use MTF50P (True) or MTF50 (False) algorithms.
    'use_50p': False,

    # Number of threads running concurrently (depends on CPU core count).
    'n_thread': 4
    },

  # ALS sensor parameters
  'cam_als': {
    'calibscale': 100,

    # Light seq command
    # sequence of light name defined in chamber_cmd of ALS test argument
    'light_seq': ['LUX1', 'LUX2', 'LUX3', 'OFF'],

    # Perform calibration at this lux
    'calib_lux': 500,
    'calib_target': 125,
    'n_samples': 1,

    # Delay betwen each sample
    'read_delay': 2.0,

    # Time for wait light switch
    'light_delay': 3.0,

    # List of light intensity to test
    'luxs': [500, 1000, 30],

    # Command for saving calibration result into VPD
    'save_vpd': 'vpd -s "als_cal_data"="%d"',
  }
}
